// reentrant_demo.c
#include <signal.h>
#include <unistd.h>
#include <stdio.h>

void sigHandler(int signum) {
    write(1, "Signal received\n", 15); // 使用write代替printf
}

int main() {
    signal(SIGINT, sigHandler);
    while (1) {
        sleep(1);
    }
    return 0;
}
